<template>
	<view>


		<view class="" style="height: 600px;">


			<view class=" p2 bb" style="width: 200px;">
				<view class="">
					<button @click="on_set_che()" class="f-15 banmi_flex a-c j-c b_y cff"
						style="background-color: #A9A9A9;width: 160px;height: 40px;border-radius: 10rpx;">
						一键清空
					</button>
				</view>
			</view>




		</view>

	</view>
</template>

<script>
	export default {
		props: {

			money: {
				type: Number,
				default: 1
			},

			version: {
				type: String,
				default: ''
			},

			list_goods: {
				type: Array,
				default: function() {
					return [] //数据
				}
			}
		},
		data() {
			return {
				codetime: 8,
				find: {},
				name: '',
				keya: ''
			};
		},
		mounted() {
			this.init();

		},
		methods: {
			on_set_che() {
				var that = this;
				uni.showModal({
					title: '提示',
					content: '确认清空缓存吗？',
					success: function(res) {
						if (res.confirm) {
							that.on_che();
						}
					}
				})
			},
			on_che() {
				var that = this;
				this.Htpp.STS_che_ajax().then(ret => {
					console.log("ret: " + JSON.stringify(ret));
				})


			},

			on_set_name(name, key) {
				this.name = name;
				this.keya = key;
				this.$refs.alertDialog.open()

			},
			on_is_account() {
				var that = this;
				uni.showActionSheet({
					itemList: ['开启', '不开启'],
					success: function(res) {
						var is_account = 0;
						if (res.tapIndex == 0) {
							var is_account = 1;
						}
						that.keya = 'is_account';

						that.onxiugai(is_account);
					}
				});
			},
			on_force_tel() {
				var that = this;
				uni.showActionSheet({
					itemList: ['强制绑定', '不强制'],
					success: function(res) {
						var force_tel = 0;
						if (res.tapIndex == 0) {
							var force_tel = 1;
						}
						that.keya = 'force_tel';

						that.onxiugai(force_tel);
					}
				});
			},
			on_set_wechats() {
				var that = this;
				uni.showActionSheet({
					itemList: ['关闭微信', '开启微信'],
					success: function(res) {
						var val = 0;
						if (res.tapIndex == 0) {
							var val = 1;
						}
						that.keya = 'is_wechats';

						that.onxiugai(val);
					}
				});
			},

			on_set_is_sms() {
				var that = this;
				uni.showActionSheet({
					itemList: ['关闭短信', '开启短信'],
					success: function(res) {
						var val = 0;
						if (res.tapIndex == 0) {
							var val = 1;
						}
						that.keya = 'is_sms';

						that.onxiugai(val);
					}
				});
			},
			onxiugai(val) {
				var that = this;
				this.Htpp.STS_set_key_sets_ajax(val, that.keya).then(ret => {
					this.find[that.keya] = val;
				})


			},
			on_qiniu_region() {
				var that = this;
				var list = ['华东-ECN', '华南-SCN', '华北-NCN', '北美-NA', '新加坡-ASG'];
				uni.showActionSheet({
					itemList: ['华东-ECN', '华南-SCN', '华北-NCN', '北美-NA', '新加坡-ASG'],
					success: function(res) {
						var aa = list[res.tapIndex]
						that.on_set_region(aa);


					}
				});
			},
			on_set_region(region) {

				this.Htpp.STS_set_key_QRN_ajax(region).then(ret => {
					this.find.qiniu_region = region;
				})


			},

			on_set_platform() {
				var that = this;
				uni.showActionSheet({
					itemList: ['不限制', '微信公众号'],
					success: function(res) {
						var platform = 1;
						if (res.tapIndex == 0) {
							var platform = 0;
						}
						that.on_set_platform_a(platform);
					}
				});
			},
			on_set_platform_a(platform) {


				this.Htpp.STS_set_key_platform_ajax(platform).then(ret => {
					this.find.platform = platform;
				})


			},
			on_set_yun() {
				var that = this;
				uni.showActionSheet({
					itemList: ['关闭站点', '上线运营'],
					success: function(res) {
						var system = 0;
						if (res.tapIndex == 0) {
							var system = 1;
						}
						that.on_set_system(system);
					}
				});
			},
			on_tupian() {
				var that = this;
				uni.showActionSheet({
					itemList: ['本地储存', '七牛云储存'],
					success: function(res) {
						var ip_sms_test = 1;
						if (res.tapIndex == 0) {
							var ip_sms_test = 0;
						}
						that.on_set_oss(ip_sms_test);
					}
				});
			},
			on_set_system(system) {
				this.Htpp.STS_set_key_system_ajax(system).then(ret => {
					this.find.system = system;
				})
			},
			on_set_oss(oss) {
				this.Htpp.STS_set_key_OSS_ajax(oss).then(ret => {
					this.find.oss = oss;
				})
			},

			on_tiaoshi() {
				var that = this;
				uni.showActionSheet({
					itemList: ['调试模式', '运营模式'],
					success: function(res) {
						var ip_sms_test = 1;
						if (res.tapIndex == 0) {
							var ip_sms_test = 0;
						}
						that.on_ip_sms_test(ip_sms_test);
					}
				});
			},
			on_ip_sms_test(ip_sms_test) {
				this.Htpp.STS_set_key_IST_ajax(ip_sms_test).then(ret => {
					this.find.ip_sms_test = ip_sms_test;
				})
			},
			init() {

				this.Htpp.in_admin_index_ajax('').then(ret => {

					this.find = ret


				})


			}
		}
	}
</script>

<style lang="scss">
	.newmask {
		position: fixed;
		top: 0;
		left: 0;
		width: 750px;
		height: 2500px;
		z-index: 8888;
		background-color: rgba(0, 0, 0, 0.6);
	}

	.btn {
		width: 70%;
		margin: 20px auto;
		margin-top: 40px;
		padding: 20px 0px;
		text-align: center;
		background: #4884FF;
		border-radius: 34px;
		font-size: 30px;
		color: #fff;
	}

	//微信弹窗
	.wxbox {
		position: absolute;
		top: 20%;
		z-index: 9999;
		width: 80%;
		left: 10%;
		background-color: #fff;
		border-radius: 30px;
		padding: 30px 0px;

		.close {
			position: absolute;
			top: 5px;
			right: 10px;
			z-index: 9999;
			text-align: center;
		}

		.weixin {
			margin: 20px 0 0 0px;
			text-align: center;

			image {
				width: 100px;
				height: 100px;
			}
		}

		.tips {
			padding: 10px 20px;
			text-align: center;
			font-size: 35px;
			color: #333;
		}
	}

	//红包弹窗
	.redbox {
		position: fixed;
		top: 250px;
		z-index: 9998;
		width: 675px;
		left: 37.5px;
		padding: 10px 0px;




	}

	.messBox {
		position: absolute;
		top: 12%;
		z-index: 9998;
		width: 80%;
		left: 10%;
		padding: 150px 0px;

		.wrapBox {
			background-color: #fff;
			border-radius: 20px;
			padding: 30px;

			.title {
				text-align: center;
				font-size: 32px;
				font-weight: bold;
			}

			.desc {
				height: 400px;
				margin-top: 20px;
				font-size: 30px;
			}
		}
	}

	.updateBox {
		position: absolute;
		top: 20%;
		z-index: 9998;
		height: 300px;
		width: 80%;
		left: 10%;

		.tubiao {
			text-align: center;

			image {
				z-index: 999;
				width: 200px;
				height: 130px;
			}
		}

		.wrapbox {
			position: relative;
			z-index: 9999;
			top: -70px;
			background-color: #fff;
			border-radius: 10px;
			padding: 30px 40px;

			.version {
				margin-top: 50px;
				font-size: 35px;
				color: #333;
				font-weight: bold;
				text-align: center;
			}

			.desc-t {
				margin-top: 30px;
				font-size: 32px;
				font-weight: bold;
			}
		}
	}

	.updateBox1 {
		position: absolute;
		top: 15%;
		z-index: 9999;
		width: 80%;
		left: 10%;
		padding: 10px;
		height: 700px;

		image {
			width: 100%;
			height: 100%;
		}

		.wrapBox {
			position: absolute;
			width: 85%;
			left: 50px;
			top: 40px;
			padding: 10px 20px;

			.version {
				font-size: 35px;
				color: #fff;
			}

			.desc-t {
				margin-top: 100px;
				font-size: 32px;
				font-weight: bold;
			}
		}
	}

	.desc {
		height: 230px;
		overflow: scroll;
		margin-top: 10px;
		font-size: 30px;
		color: #666;
		line-height: 50px;
	}

	.btnbox {
		display: flex;
		justify-content: space-around;
		margin: 40px 0px 20px 0px;
		margin-top: 50px;

		.btnno {
			padding: 10px 30px;
			background-color: #f8f8f8;
			border-radius: 10px;
			font-size: 30px;
			color: #666;
		}

		.btnUp {
			padding: 10px 30px;
			background-color: #4884FF;
			border-radius: 10px;
			font-size: 30px;
			color: #fff;
		}
	}
</style>